  if(lineLink&&shareTitle){
  function share_scene(link, scene_type){ 
    var tid='';
    var extargs = "";  
    if (tid != ""){//gdt traceid  
        extargs = "tid=" + tid + "&aid=" + 54;//share must be 54  
    }  
	
    var queryStr = link.split('?')[1] || '';  
        queryStr = queryStr.split('#')[0];  
    if( queryStr == '' ){  
        return;  
    }   
    var queryarr = [queryStr, 'scene='+scene_type];  
    (extargs != "") && (queryarr.push(extargs));  
    queryStr = queryarr.join('&');  
    //alert(scene_type); 
    return link.split('?')[0] + '?' + queryStr + '#' + (link.split('#')[1]||'');  
} 
  
   var ua = navigator.userAgent.toLowerCase();
    function shareFriend() {
	      // alert(lineLink);
            WeixinJSBridge.invoke('sendAppMessage',{

                "img_url": imgUrl,
                "img_width": "200",
                "img_height": "200",
                "link": lineLink,
                "desc": descContent,
                "title": shareTitle
            }, function(res) {
			   
               // _report('send_msg', res.err_msg);
            })
        }
        function shareTimeline() {
            WeixinJSBridge.invoke('shareTimeline',{
                "img_url": imgUrl,
                "img_width": "200",
                "img_height": "200",
                "link": lineLink,
                "desc": descContent,
                "title": shareTitle
            }, function(res) {
                   //_report('timeline', res.err_msg);
            });
        }
        function shareWeibo() {
            WeixinJSBridge.invoke('shareWeibo',{
                "content": descContent,
                "url": lineLink,
            }, function(res) {
                //_report('weibo', res.err_msg);
            });
        }
		// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事
        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
            // 发送给好友
			 if(ua.indexOf("android")>0) {  
                 WeixinJSBridge.on('menu:share:appmessage', function(argv){
			 
                shareFriend();
                 });
				 // 分享到朋友圈
            WeixinJSBridge.on('menu:share:timeline', function(argv){
                shareTimeline();
            });
            // 分享到微博
            WeixinJSBridge.on('menu:share:weibo', function(argv){
                shareWeibo();
            });
            } else {  
       　            //苹果分享时会调用此函数  
          WeixinJSBridge.on('menu:general:share', function(argv){  
              var scene = 0;  
               switch(argv.shareTo){  
               case 'friend'  : scene = 1; break;  
               case 'timeline': scene = 2; break;  
               case 'weibo'   : scene = 3; break;  
               }  
  
            argv.generalShare({  
 
                                "img_url"    : imgUrl,  
                                "img_width"  : "200",  
                                "img_height" : "200",  
                                "link"       : share_scene(lineLink,scene),  
                                "desc"       : descContent,  
                                "title"      : shareTitle  
             }, function(res){  
  
              });  
                  });  
          }  

           
            
        }, false);
  
  }
  
   